var express = require('express');
var router = express.Router();

const reservation = require("../controller/reservation");
const auth = require("../controller/auth");

//增加预约
router.post("/add", auth.isLogin,reservation.add);
//修改预约
router.put("/update/:id", auth.isLogin,auth.isSelfOfAdmin, reservation.update);

//修改预约
router.put("/updateSelf/:id", auth.isLogin, reservation.updateSelf);

//获取指定预约信息
router.get("/find/:id", auth.isLogin, auth.isSelfOfAdmin, reservation.find);
//预约列表
router.get("/findAll", auth.isLogin, auth.isAdmin, reservation.findAll);

//删除预约
router.delete("/remove/:id", auth.isLogin, auth.isSelfOfAdmin, reservation.remove);
module.exports = router;